<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="sec"
	uri="http://www.springframework.org/security/tags"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="huoyun" uri="/huoyun"%>
<style type="text/css">
#submit_button {
	width: 100px;
	height: 40px;
	background-image:
		url("${pageContext.request.contextPath}/theme/images/button_normal.png");
	background-size: 100% 100%;
	border: none;
	cursor: pointer;
	font-family: 宋体;
	font-size: 18px;
	font-style: normal;
	color: #fff;
	font-weight: bold;
	background-image:
		url("${pageContext.request.contextPath}/theme/images/button_normal_ie.png")
		\9;
}

#submit_button:hover,#submit_button.hover {
	background-image:
		url("${pageContext.request.contextPath}/theme/images/button_hover.png");
	background-image:
		url("${pageContext.request.contextPath}/theme/images/button_hover_ie.png")
		\9;
}

#submit_button:active,#submit_button.active {
	background-image:
		url("${pageContext.request.contextPath}/theme/images/button_down.png");
	background-image:
		url("${pageContext.request.contextPath}/theme/images/button_down_ie.png")
		\9;
}
</style>
<script type="text/javascript">
	function add_event(tr){
		tr.onmouseover = function(){
			tr.className += ' hover';
		};
		tr.onmouseout = function(){
			tr.className = tr.className.replace(' hover', '');
		};
	}

	function stripe(table) {
		var trs = table.getElementsByTagName("tr");
		for(var i=1; i<trs.length; i++){
			var tr = trs[i];
			tr.className = i%2 != 0? 'odd' : 'even';
			add_event(tr);
		}
	}
	
	/* 弹出框：
		type=bid: 显示单个货物的所有应标信息
		type=detail: 显示单个货物的详细信息
	 */
	function openDialog(goodsId, type)
    {
    	if(type == 'bid') {
    		var urlStr = "/huoyun/cargo/getAllBiddingCars.action?goodsId="+goodsId;
    		new Dialog({type:'url', value:urlStr}, {fixed:false}, {title:'详细应标信息'}).show();
    	}
    	else if (type == 'detail') {
    		var urlStr = "/huoyun/cargo/getCargoDetailForCar.action?goodsId="+goodsId;
    		new Dialog({type:'url', value:urlStr}, {fixed:false}, {title:'详细货物信息'}).show();
    	}
    	
    }
    
    /*
		弹出窗：应标后出价
	*/
	function openDialog2()
    {
    	new Dialog('暂不可用').show();
    }

	window.onload = function(){
		var table = document.getElementById('my_registed_cars_table');
		stripe(table);
	}
	
	/*
		弹出窗：显示货主留言信息
	*/
	function openOtherInfoDialog(otherInfo)
	{
		new Dialog(otherInfo, {fixed:false}, {title:'货主留言'}).show();
	}
</script>
<div class="l-basicInfor">
	<div class="l-basicInfor-content">
		<span> <a target="_blank" href="/userprofile/avator"> <!--<img src="http://s4.zbjimg.com/r/p/task/120.gif">-->
				<img alt="设置形象标识"
					src="${pageContext.request.contextPath}<s:property value="loginUser.userImg"/>"
					style="width: 40px; width: 50px" /> </a> </a> </span>
		<span>
			<ul>
				<li class="l-basicInfor-content-name">
					<span><s:property value="user.username" /> </span>
					<s:if test="user.checkRealname==0">
						<span title="未进行实名认证"> <a
							href="http://u.zhubajie.com/real/index"> <img
									src="${pageContext.request.contextPath}/theme/images/userAdmin/erz0.png">
						</a> </span>
					</s:if>
					<s:else>
						<span title="已通过实名认证"> <a
						href="http://u.zhubajie.com/real/index"> <img src="${pageContext.request.contextPath}/theme/images/userAdmin/erz0.png">
						</a> </span>
					</s:else>
					<s:if test="user.checkEmail==0">
						<span title="未进行邮箱认证"> <a
							href="http://u.zhubajie.com/cert/email"> <img
									src="${pageContext.request.contextPath}/theme/images/userAdmin/email0.png">
						</a> </span>
					</s:if>
					<s:else>
						<span title="已经通过邮箱认证"> <a
							href="http://u.zhubajie.com/cert/email"> <img
									src="${pageContext.request.contextPath}/theme/images/userAdmin/email0.png">
						</a> </span>
					</s:else>
					<s:if test="checkBankAccount==0">
						<span title="未进行银行卡认证"> <a
							href="http://u.zhubajie.com/bank/index"> <img
									src="${pageContext.request.contextPath}/theme/images/userAdmin/bank0.png">
						</a> </span>
					</s:if>
					<s:else>
						<span title="已经通过银行卡认证"> <a
						href="http://u.zhubajie.com/bank/index"> <img
								src="${pageContext.request.contextPath}/theme/images/userAdmin/bank0.png">
						</a> </span>
					</s:else>
					<s:if test="checkMobilePhone==0">
						<span title="未进行手机认证"> <a
							href="http://u.zhubajie.com/cert/mobile"> <img
									src="${pageContext.request.contextPath}/theme/images/userAdmin/trz1.png">
						</a> </span>
					</s:if>
					<s:else>
						<span title="已经通过手机认证"> <a
							href="http://u.zhubajie.com/cert/mobile"> <img
									src="${pageContext.request.contextPath}/theme/images/userAdmin/trz1.png">
						</a> </span>
					</s:else>
				</li>
				<li>
					<span>&nbsp;积分：12</span>
				</li>
				<li>
					<span>资料完善度：</span>
					<span class="l-basicInfor-content-schedule"> <s:property
							value="userInfoCompleteRate" />% <a
						href="<s:url action="preEditUserInfo.action" namespace="userAdmin"></s:url>">立即完善</a>
						<a target="_blank" href="<s:url action="index.action" namespace="/userAdmin"></s:url>">我的主页</a>
				</li>
			</ul> </span>
	</div>
	<div class="l-basicInfor-taskInfor">
		<div class="l-basicInfor-taskInfor-bl1">
			<span> <a target="_blank" href="#"> <img alt="设置公司商标"
						src="${pageContext.request.contextPath}/theme/images/userAdmin/company_head.gif">
			</a> </span>
			<span>
				<ul>
					<s:if test="company!=null">
						<li style="font-size: 14px;">
							&nbsp;&nbsp;
							<strong>公司名：<s:property value="company.name" /> </strong>
						</li>
						<li>
							&nbsp;&nbsp;信息完整度：
							<s:property value="companyCompleteRate" />
							%
						</li>
						<li>
							&nbsp;&nbsp;
							<a
								href="<s:url action="preCompany" namespace="/company"></s:url>">完善公司信息</a>
						</li>
					</s:if>
					<s:else>
						<li>
							&nbsp;&nbsp;<a
								href="<s:url action="preCompany" namespace="/company"></s:url>">添加公司信息</a>
						</li>
					</s:else>
				</ul> </span>
		</div>
	</div>
</div>
<div class="l-basicInfor-content-shadow"></div>
<div class="realR_left l-myzbj-main">
	<div class="mybox">
		<div class="mytit">
			交易看板
		</div>
		<div class="con h_lc l-myzbj-main-board clearfix"
			style="width: 558px;">
			<ul>
				<li>
					<a href="<s:url action="queryAll" namespace="/order"></s:url>">待支付订单(
					<s:property value="unPayOrderCount" />
					)</a>
				</li>
				<li>
					<a href="<s:url action="queryAll" namespace="/order"></s:url>">待确认订单(
					<s:property value="unConfirmCount" />
					)</a>
				</li>
				<li>
					<a href="<s:url action="queryAll" namespace="/order"></s:url>">待评论订单(
					<s:property value="unCommentCount" />
					)</a>
				</li>
			</ul>
		</div>
	</div>

	<div class="realR_left l-myzbj-main" style="top-padding: 10px">
		<div class="mybox">
			<div class="mytit">
				我正参与的应标/竞标（等待货主选标）
				<span style="float:right">
					<s:if test="myBiddingInfoList.totalRecord >= 5"><a href="${pageContext.request.contextPath}/car/showMyBiddedGoods.action">更多>></a></s:if>
				</span>
			</div>
			<div class="con h_lc l-myzbj-main-board clearfix"
				style="width: 558px;">
				<form method="post">
					<table class="listTable">
						<tr>			
							<th>
								车牌号
							</th>
							<th>
								货物类型
							</th>
							<th>
								数量
							</th>
							<th>
								货主报价
							</th>
							<th>
								我的出价
							</th>
							<th>
								应标人数
							</th>
							<th>
								详细信息
							</th>
							<th>
								退标
							</th>
						</tr>
						<s:iterator value="myBiddingInfoList.ObjectList" id="biddingInfo" status="st">
							<tr>
								<td>
									<s:property value="#biddingInfo.car.cardNumber" />
								</td>
								<td>
									<huoyun:customSelect mode="cargoPackageType"
										value="${biddingInfo.cargoInfo.type }" type="view" />
								</td>
								<td>
									<s:property value="#biddingInfo.cargoInfo.amount" />
									<huoyun:customSelect mode="measureType"
										value="${biddingInfo.cargoInfo.measure }" type="view" />
								</td>
								<td>
									<font size="2">&yen;</font>
									<s:property value="#biddingInfo.cargoInfo.freight" />
									元
								</td>
								<td>
									<font size="2" color="red">&yen;<s:property
											value="#biddingInfo.bidInfo.price" />元</font>
								</td>
								<td>
									<a href=""
										onclick="openDialog(<s:property value="#biddingInfo.cargoInfo.id"/>,'bid'); return false;"><s:property
											value="#biddingInfo.biddingCarCount" />人应标该货物</a>
								</td>
								<td>
									<a href=""
										onclick="openDialog(<s:property value="#biddingInfo.cargoInfo.id"/>,'detail'); return false;">详细信息</a>
								</td>
								<td>
									<input type="button" value="退标"
										onclick="if(confirm('确定要退标吗？')){this.form.action='/huoyun/car/deleteBidInfo.action?bidInfoId=<s:property value="#biddingInfo.bidInfo.id"/>'; this.form.submit();}" />
								</td>
							</tr>
						</s:iterator>
					</table>
				</form>
			</div>
		</div>
	</div>
	<div class="realR_left l-myzbj-main" style="top-padding: 10px">
		<div class="mybox">
			<div class="mytit">
				货主邀请的应标/竞标（等待我确认）
				<span style="float:right">
					<s:if test="myInviteCarModelList.totalRecord > 5"><a href="#">更多>></a></s:if>
				</span>
			</div>
			<div class="con h_lc l-myzbj-main-board clearfix"
				style="width: 558px;">
				<form method="post">
				<table class="listTable">
					<tr>
					
						<th>
							车牌号
						</th>
						<th>
							货物类型
						</th>
						<th>
							吨位
						</th>
						<th>
							运输总价
						</th>
						<th>
							货主留言
						</th>
						<th>
							货物详细信息
						</th>
						<th>
							确认
						</th>
					</tr>
					<s:iterator value="myInviteCarModelList.ObjectList" id="inviteCarModel"
						status="st">
						<tr>
							<td>
								<s:property value="#inviteCarModel.car.cardNumber" />
							</td>
							<td>
								<huoyun:customSelect mode="cargosType"
									value="${inviteCarModel.cargoInfo.type }" type="view" />
							</td>
							<td>
								<s:property value="#inviteCarModel.cargoInfo.amount" />
								<huoyun:customSelect mode="measureType"
									value="${inviteCarModel.cargoInfo.measure }" type="view" />
							</td>
							<td>
								<font size="2">&yen;</font>
								<s:property value="#inviteCarModel.inviteCar.price" />
								元
							</td>
							<td>
								<a href=""
									onclick="openOtherInfoDialog('<s:property value="#inviteCarModel.inviteCar.otherInfo"/>'); return false;">查看留言</a>
							</td>
							<td>
								<a href=""
									onclick="openDialog(<s:property value="#inviteCarModel.cargoInfo.id"/>,'detail'); return false;">详细信息</a>
							</td>
							<td>
								<button
									onclick="if(confirm('确定要应标吗？')){this.form.action='/huoyun/car/acceptInvitedBid.action?goodsId=${inviteCarModel.cargoInfo.id}&carId=${inviteCarModel.car.id}&inviteCarId=${inviteCarModel.inviteCar.id}&price=${inviteCarModel.cargoInfo.freight}'; this.form.submit(); return true;} else return false;">
									应标
								</button>
							</td>
						</tr>
					</s:iterator>
				</table>
				
				</form>
			</div>
		</div>
	</div>
	<div class="realR_left l-myzbj-main" style="top-padding: 10px">
		<div class="mybox">
			<div class="mytit">
				已经达成的交易
				<span style="float:right">
					<s:if test="mySuccessBidInfoList.totalRecord >= 5"><a href="${pageContext.request.contextPath}/car/showMyBiddedGoods.action">更多>></a></s:if>
				</span>
			</div>
			<div class="con h_lc l-myzbj-main-board clearfix"
				style="width: 558px;">
				<form method="post">
					<table class="listTable">
									<tr style="background-color: silver;">
										<th>序号</th>
										<th>车牌号</th>
										<th>货物类型</th>
										<th>吨位</th>
										<th>成交价格</th>
										<th>详细信息</th>
									</tr>
									<s:iterator value="mySuccessBidInfoList.ObjectList" id="successBidInfo"
										status="st">
										<tr>
											<td><s:property value="#st.index+1"/> </td>
											<td><s:property value="#successBidInfo.car.cardNumber" />
											</td>
											<td><huoyun:customSelect mode="cargosType" value="${successBidInfo.cargoInfo.type }" type="view"/>
											</td>
											<td><s:property value="#successBidInfo.cargoInfo.amount" />
												<huoyun:customSelect mode="measure" value="${successBidInfo.cargoInfo.measure }" type="view"/>
											</td>
											<td><font size="2">&yen;</font><s:property value="#successBidInfo.bidInfo.price" />元</td>
											<td><a href=""
												onclick="openDialog(<s:property value="#successBidInfo.cargoInfo.id"/>,'detail'); return false;">详细信息</a>
											</td>
										</tr>
									</s:iterator>
								</table>
				
				</form>
			</div>
		</div>
	</div>
</div>
<div class="realR_left l-myzbj-sidebar"
	style="float: right; width: 210px;">
	<div class="mybox mb10"></div>
	<div class="mybox mb10">
		<div class="l-myzbj-sidebar-title">
			雇主说
		</div>
		<div class="con">
			<ul class="b_entry clearfix fc6">
				<li style="height: 90px; overflow: hidden; margin-bottom: 8px;">
					<a title="" target="_blank"
						href="http://www.easybuy.com.cn/topic/easybuy_zhubajie.html ">
						<img class="" border="0"
							src="http://p4.zbjimg.com/task/2012-12/10/pub/50c59e1e547bf.jpg">
					</a>
				</li>
				<li>
					1111111111
				</li>
				<li>
					1111111111
				</li>
			</ul>
		</div>
	</div>
	<div class="mybox mb10"></div>
</div>
</div>